﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TimeTravel.XnaLibrary.GamePlay
{
	/// <summary>
	/// Represents an upgrade boost that appears randomly on the game map.
	/// </summary>
	public struct UpgradeBoost
	{
		private readonly float mFactor;
		private readonly int mPosition;

		/// <summary>
		/// Gets the factor to upgrade the unit with.
		/// </summary>
		public float Factor
		{
			get { return mFactor; }
		}

		/// <summary>
		/// Gets the position on the game map.
		/// </summary>
		public int Position
		{
			get { return mPosition; }
		}

		/// <summary>
		/// Initiliazes a new UpgradeBoost on a map with the specified length.
		/// </summary>
		/// <param name="arenaLength"></param>
		public UpgradeBoost(int arenaLength)
		{
			mFactor = Unit.BasicUpgradeFactor * Utilities.CalculateRandomFactor();
			mPosition = (int) (arenaLength * Player.Rng.NextDouble());
		}
	}
}
